home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlIpAddressGet.au3 < prev    next >
Text File  |  2007-09-08  |  901b  |  37 lines

  1. #include <GuiIPAddress.au3>
  2.  
  3. Opt("MustDeclareVars", 1)
  4.  
  5. Global $hIPAddress
  6.  
  7. _Main()
  8.  
  9. Func _Main()
  10.     Local $msg, $hgui, $clear, $getaddress, $button, $hIPAddress
  11.     
  12.     $hgui = GUICreate("IP Address Control Create Example", 300, 150)
  13.     
  14.     $hIPAddress = _GUICtrlIpAddressCreate ($hgui, 10, 10, 125, 30, $WS_THICKFRAME)
  15.     
  16.     $clear = GUICtrlCreateButton("Clear IP", 10, 50, 80, 20)
  17.     $getaddress = GUICtrlCreateButton("Get IP", 95, 50, 80, 20)
  18.     
  19.     $button = GUICtrlCreateButton("Exit", 100, 100, 100, 25)
  20.     _GUICtrlIpAddressSet ($hIPAddress, "24.168.2.128")
  21.     GUISetState(@SW_SHOW)
  22.     
  23.     While 1
  24.         $msg = GUIGetMsg()
  25.         
  26.         Select
  27.             
  28.             Case $msg = $GUI_EVENT_CLOSE Or $msg = $button
  29.                 Exit
  30.             Case $msg = $clear
  31.                 _GUICtrlIpAddressClear ($hIPAddress)
  32.             Case $msg = $getaddress
  33.                 MsgBox(0, "IP Entered", _GUICtrlIpAddressGet ($hIPAddress))
  34.         EndSelect
  35.     WEnd
  36. EndFunc   ;==>_Main
  37.